import static java.lang.System.out;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Test {
	
	public static void main(String args[]){
		
		final String EDGES = "Edges: ";
		final String AREA = "Area: ";
		final String PERIMETER = "Perimeter: ";
			
		out.println("TestCase #00 create Square");
		Square square = null;
		try {
			square = new Square(4.0);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+square.edges());
		out.println(AREA+square.area());
		out.println(PERIMETER+square.perimeter());
		
		out.println("TestCase #01 create Square with invalid length");
		Square square_fault = null;
		try {
			square_fault = new Square(0);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		out.println("TestCase #02 scale Square");
		try {
			square.scale(3.5);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+square.edges());
		out.println(AREA+square.area());
		out.println(PERIMETER+square.perimeter());
		
		out.println("TestCase #02 scale Square with invalid value");
		try {
			square.scale(-3.5);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		
		out.println("TestCase #03 create EquilateralTriangle");
		EquilateralTriangle equilateraltriangle = null;
		try {
			equilateraltriangle = new EquilateralTriangle(4.0);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+equilateraltriangle.edges());
		out.println(AREA+equilateraltriangle.area());
		out.println(PERIMETER+equilateraltriangle.perimeter());
		
		out.println("TestCase #04 create EquilateralTriangle with invalid length");
		EquilateralTriangle equilateraltriangle_fault = null;
		try {
			equilateraltriangle_fault = new EquilateralTriangle(-3);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		out.println("TestCase #05 scale EquilateralTriangle");
		try {
			equilateraltriangle.scale(6.5);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+square.edges());
		out.println(AREA+square.area());
		out.println(PERIMETER+square.perimeter());
		
		out.println("TestCase #06 scale EquilateralTriangle with invalid value");
		try {
			equilateraltriangle.scale(-6.5);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		
		out.println("TestCase #07 create RegularPolygon");
		RegularPolygon regularpolygon = null;
		try {
			regularpolygon = new RegularPolygon(7,5.77);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+regularpolygon.edges());
		out.println(AREA+regularpolygon.area());
		out.println(PERIMETER+regularpolygon.perimeter());
		
		out.println("TestCase #08 create RegularPolygon with invalid length");
		RegularPolygon regularpolygon_fault0 = null;
		try {
			regularpolygon_fault0 = new RegularPolygon(6,-7);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}	
		
		out.println("TestCase #09 create RegularPolygon with invalid edges");
		RegularPolygon regularpolygon_fault1 = null;
		try {
			regularpolygon_fault1 = new RegularPolygon(2,5.77);
		} catch (NotEnoughEdgesException ex) {
			out.println(ex.getMessage());
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		
		out.println("TestCase #10 create Rectangle");
		Rectangle rectangle = null;
		try {
			rectangle = new Rectangle(5, 7);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+rectangle.edges());
		out.println(AREA+rectangle.area());
		out.println(PERIMETER+rectangle.perimeter());
		
		out.println("TestCase #11 create Rectangle with invlid length");
		Rectangle rectangle_fault = null;
		try {
			rectangle_fault = new Rectangle(5, -7);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		out.println("TestCase #12 scale Rectangle");
		try {
			rectangle.scale(5.7);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+rectangle.edges());
		out.println(AREA+rectangle.area());
		out.println(PERIMETER+rectangle.perimeter());
		
		out.println("TestCase #12 scale Rectangle with invalid values");
		try {
			rectangle.scale(-5.7);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		out.println("TestCase #13 create Triangel");
		Triangle triangle = null;
		try {
			triangle = new Triangle(3, 5, 7);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		out.println(EDGES+triangle.edges());
		out.println(AREA+triangle.area());
		out.println(PERIMETER+triangle.perimeter());
			
		out.println("TestCase #09 create Triangel with invalid length");
		Triangle triangle_fault = null;
		try {
			triangle_fault = new Triangle(3, -5, 7);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		out.println("TestCase #14 set Triangel with invalid lengt");
		try {
			triangle.setB(-8);
		} catch (ValueSmallerZeroException ex) {
			out.println(ex.getMessage());
		}
		
		out.println("TestCase #15 FINAL TEST");
		RegularPolygon regularpolygons[] = new RegularPolygon[3];
		regularpolygons[0]=square;
		regularpolygons[1]=equilateraltriangle;
		regularpolygons[2]=regularpolygon;
		
		for(int i = 0;i<regularpolygons.length;i++) {
			try {
				regularpolygons[i].scale(3);
			} catch (ValueSmallerZeroException ex) {
				out.println(ex.getMessage());
			}
		}
		
		for(int k = 0;k<regularpolygons.length;k++) {
			out.println(EDGES+regularpolygons[k].edges());
			out.println(AREA+regularpolygons[k].area());
			out.println(PERIMETER+regularpolygons[k].area());
		}
		
		
		
	
	
	}
	
	
	
}
